<template>
	<view 
		:style="{ backgroundColor: bgColor }"
		class="search-wrapper bg-w flex flex-align-center flex-space-between"
	>
		<!-- <uni-search-bar style="padding: 0;margin: 20rpx 0;" radius="100" placeholder="你想住在哪?" clearButton="none" cancelButton="none" @confirm="" @input="" /> -->
		<image style="width: 36rpx;height: 36rpx;" src="http://jiaoyukehu.oss-cn-beijing.aliyuncs.com/static/home/ic_search.png" mode=""></image>
		<input class="flex-1" type="text" :placeholder="placeholder || '搜索'" placeholder-class="placeholder-class">
		<view v-if="showButton" class="felx button-search flex flex-center color-w font32">
			查询
		</view>
	</view>
</template>

<script lang="ts" setup>
	const props = defineProps({
		bgColor: {
			type: String,
			default: '#fff'
		},
		placeholder: {
			type: String,
			default: ''
		},
		showButton: {
			type: Boolean,
			default: false
		}
	})
</script>

<style lang="scss" scoped>
	.search-wrapper {
		padding: 22rpx 30rpx;
		border-radius: 20rpx;
		position: relative;
		image {
			margin-right: 30rpx;
		}
		.placeholder-class {
			color: #B5B5B5;
			font-size: 32rpx;
		}
	}
	.button-search {
		width: 120rpx;
		position: absolute;
		background: #3FA897;
		border-radius: 20rpx;
		right: 0;
		top: 0;
		bottom: 0;
	}
</style>